=Command Line Interface=
'''ES''' is the command-line interface for searching '''''Everything''''' from a command prompt or PowerShell.

[[#download|Download]]
[[#requirements|Requirements]]
[[#usage|Usage]]
[[#search_options|Search options]]
[[#sort|Sort options]]
[[#display|Display options]]
[[#journal|Journal options]]
[[#export|Export options]]
[[#general|General options]]
[[#macros|Bookmarks and filters]]
[[#exitcode|Exit codes]]
[[#examples|Examples]]

[[File:support/everything/es-no-shadow.png|alt=Everything ES command line interface]]



==Download==
Download '''ES''' from the [[downloads#cli|Downloads page]].



==Requirements==
<ul>
*'''''Everything''''' must be installed and running.
</ul>



==Usage==
`es.exe [options] search text`

<dl>
;options
Optional switches that change search behavior, sorting, or output formatting.

;search text
Optional search query using the [[support/everything/searching/|Everything search syntax]].
</dl>

For example:
`es.exe -highlight Everything ext:exe;ini`



Switches can start with either a dash (`-`) or forward slash (`/`)
For example:
`/highlight` is the same as `-highlight`



Dashes (`-`) inside switches can be omitted.
For example:
`-nodigitgrouping` is the same as `-no-digit-grouping`



Use double quotes (`"`) to escape spaces and switches.
Double quotes are treated literally and are included in your Everything search query.



Toggleable switches can be disabled by prefixing them with `no-`
For example:
`-no-size` disables `-size`



Use `^` to escape `\`, `&`, `|`, `>`, `<`, and `^` in a command prompt.



==search_options|Search options==

<dl>
;-regex|-regex <search>
;-r|-r <search>
Search using a regular expression.

;-case
;-i
Enable case-sensitive matching.

<span id="-wholeword"></span>;-whole-word
<span id="-wholewords"></span>;-whole-words
;-ww
Match whole words only.

;-match-path
;-p
Match against the full path.

;-diacritics
;-a
Enable diacritics matching.

;-prefix
Match the start of words.

;-suffix
Match the end of words.

<span id="-ignorepunctuation"></span>;-ignore-punctuation
Ignore punctuation in filenames.

<span id="-ignorewhitespace"></span>;-ignore-whitespace
Ignore whitespace in filenames.

;-count|-count <num>
;-n|-n <num>
Limit the maximum number of results to <num>.

;-path|-path <path>
Search for files and folders within the specified path.

;-parent-path|-parent-path <path>
Search for files and folders within the parent directory of the specified path.

;-parent|-parent <path>
Search for files and folders with the specified parent path.

;-ad|/ad
Search for folders only.

;-a-d|/a-d
Search for files only.

;-dir-a|/a<attributes>
Search by file attributes using DIR-style flags:
{|
! Attribute !! Description
|-
| R || Read-only
|-
| H || Hidden
|-
| S || System
|-
| D || Directory
|-
| A || Archive
|-
| V || Device
|-
| X || No scrub data
|-
| N || Normal
|-
| T || Temporary
|-
| L || Reparse point
|-
| C || Compressed
|-
| O || Offline
|-
| I || Not content indexed
|-
| E || Encrypted
|-
| U || Unpinned
|-
| P || Pinned
|-
| M || Recall on data access
|-
| - || Prefix a flag with `-` to exclude (for example: `/a-h` for non-hidden)
|}
</dl>



==sort|Sort options==

<dl>
;-s
Sort results by full path.

;-sort|-sort <property-name[-ascending|-descending]>
Sort results by the specified property and direction.

Supported sort property names:
<ul>
*name
*path
*size
*extension
*date-created
*date-modified
*date-accessed
*attributes
*filelist-filename
*run-count
*date-recently-changed
*date-run
</ul>

[[support/everything/properties/|All other properties]] are also supported.
For example:
`-sort length`
<beta1.5>

;-dir-on|/on
;-dir-o-n|/o-n
;-dir-os|/os
;-dir-o-s|/o-s
;-dir-oe|/oe
;-dir-o-e|/o-e
;-dir-od|/od
;-dir-o-d|/o-d
Sort results using DIR-style order flags:
{|
! Flag !! Description
|-
| N || Name
|-
| S || Size
|-
| E || Extension
|-
| D || Date modified
|-
| - || Sort in descending order (for example: `/o-s` for size descending)
|}
</dl>



==display|Display options==

<dl>
;-name
<span id="-location"></span><span id="-pathcolumn"></span>;-path-column
<span id="-fullpath"></span>;-full-path
<span id="-ext"></span>;-extension|-extension, -ext
;-size
<span id="-dc"></span><span id="-datecreated"></span>;-date-created|-date-created, -dc
<span id="-dm"></span><span id="-datemodified"></span>;-date-modified|-date-modified, -dm
<span id="-da"></span><span id="-dateaccessed"></span>;-date-accessed|-date-accessed, -da
<span id="-attrib"></span><span id="-attribs"></span>;-attributes|-attributes, -attribs, -attrib
<span id="-filelistfilename"></span>;-filelist-filename
<span id="-runcount"></span>;-run-count
<span id="-daterun"></span>;-date-run
<span id="-rc"></span><span id="-daterecentlychanged"></span>;-date-recently-changed|-date-recently-changed, -rc
Show the specified column.

[[support/everything/properties/|All other properties]] are also supported as `-<property-name>`
For example:
`-length -width -height`
<beta1.5>

;-add-columns|-add-columns <property-names>
Show the specified columns.

Supports [[support/everything/properties/|all properties]].
Use a semicolon (`;`) to separate multiple property names.

For example:
`-add-columns size;date-modified`
<beta1.5>

;-highlight
Highlight matching text in results.
<warning>Highlighting many results can decrease the performance of ES.</warning>

;-highlight-color|-highlight-color <color>
Set the highlight color.

The highlight color can be one of the following color codes (`0x00` to `0xFF`):
[[File:support/everything/es-colors.png|alt=command prompt console colors and codes]]

The default highlight color is 0x0A (light green on black).

;-viewport-offset|-viewport-offset <offset>
Start displaying results from the specified zero-based offset.

;-viewport-count|-viewport-count <num>
Limit the number of results shown to <num>.

;-csv
;-efu
;-json
;-m3u
;-m3u8
;-tsv
;-txt
Change the output format.

;-size-format|-size-format <format>
Set the size format.

The format can be one of the following:
{|
! Value !! Description
|-
| 0 || Auto
|-
| 1 || Bytes (default)
|-
| 2 || KB
|-
| 3 || MB
|}

;-date-format|-date-format <format>
Set the date format.

The format can be one of the following:
{|
! Value !! Description
|-
| 0 || Auto
|-
| 1 || ISO-8601
|-
| 2 || FILETIME
|-
| 3 || ISO-8601 (UTC)
|-
| 4 || User Locale
|-
| 5 || ISO-8601 (full resolution)
|-
| 6 || ISO-8601 (UTC) (full resolution)
|}

;-filename-color|-filename-color <color>
;-name-color|-name-color <color>
;-path-color|-path-color <color>
;-extension-color|-extension-color <color>
;-size-color|-size-color <color>
;-date-created-color|-date-created-color <color>, -dc-color <color>
;-date-modified-color|-date-modified-color <color>, -dm-color <color>
;-date-accessed-color|-date-accessed-color <color>, -da-color <color>
;-attributes-color|-attributes-color <color>
;-filelist-filename-color|-filelist-filename-color <color>
;-run-count-color|-run-count-color <color>
;-date-run-color|-date-run-color <color>
;-date-recently-changed-color|-date-recently-changed-color <color>, -rc-color <color>
Set the specified column to the specified color.

Column colors can also be set with:
<span id="-set-column-colors"></span><span id="-setcolumncolors"></span><span id="-setcolumncolor"></span>`-set-column-colors <property-name=color>`
Supports [[support/everything/properties/|all properties]].
Use a semicolon (`;`) to separate multiple `property-name=color` entries.

For example:
`-set-column-colors length=0x0b;width=0x0c;height=0x0d`
<beta1.5>

The column color can be one of the following color codes (`0x00` to `0xFF`):
[[File:support/everything/es-colors.png|alt=command prompt console colors and codes]]

;-filename-width|-filename-width <width>
;-name-width|-name-width <width>
;-path-width|-path-width <width>
;-extension-width|-extension-width <width>
;-size-width|-size-width <width>
;-date-created-width|-date-created-width <width>, -dc-width <width>
;-date-modified-width|-date-modified-width <width>, -dm-width <width>
;-date-accessed-width|-date-accessed-width <width>, -da-width <width>
;-attributes-width|-attributes-width <width>
;-filelist-filename-width|-filelist-filename-width <width>
;-run-count-width|-run-count-width <width>
;-date-run-width|-date-run-width <width>
;-date-recently-changed-width|-date-recently-changed-width <width>, -rc-width <width>
Set the specified column to the specified minimum width.

The width can be from `0` to `65535`.

Column widths can also be set with:
<span id="-set-column-widths"></span><span id="-setcolumnwidths"></span><span id="-setcolumnwidth"></span>`-set-column-widths <property-name=width>`
Supports [[support/everything/properties/|all properties]].
Use a semicolon (`;`) to separate multiple `property-name=width` entries.

For example:
`-set-column-widths length=5;width=3;height=3`
<beta1.5>

;-no-digit-grouping
Disable digit grouping (commas) for numbers.

;-header
Show column headings.

;-footer
Show the total number of items and total size in a footer below the results.

;-double-quote
Wrap paths and filenames with double quotes.
</dl>



==journal|Journal options==

<beta1.5>

<dl>
;-journal|-journal [filename-filter]
;-j|-j [filename-filter]
Show index journal changes.

Any journal option below also shows journal changes.

Optionally specify a filename filter to match journal changes by filename.
The whole filename is matched case-insensitively.
Wildcards are supported in the filename filter.
Use a path separator (`\`) to match the full path.
The filename filter is matched against both the filename before and after the change.

;-get-journal-id
Return the current journal ID.

;-get-journal-pos
Return the current journal ID and next change ID.

;-action-filter|-action-filter <actions>
Show only changes with the specified actions.

Use a semicolon (`;`) to separate multiple actions.

Actions can be one or more of the following:
<ul>
*folder-create
*folder-delete
*folder-rename
*folder-move
*folder-modify
*file-create
*file-delete
*file-rename
*file-move
*file-modify
</ul>

;-added-filename-only
Match filenames created, renamed, or moved after the change.

;-removed-filename-only
Match filenames deleted, renamed, or moved before the change.

;-watch
Return when a matching journal change is found and display the journal position.

;-from-journal-pos|-from-journal-pos <journal-id> <change-id>
;-from-journal-id|-from-journal-id <journal-id>
;-from-change-id|-from-change-id <change-id>
Show changes starting from the specified position.

;-from-date|-from-date <date>
Show changes starting from the specified ISO-8601 date.

;-from-yesterday
Show changes starting from the beginning of yesterday.

;-from-today
Show changes starting from the beginning of today.

;-from-now
Show changes starting from the current time.

;-to-journal-pos|-to-journal-pos <journal-id> <change-id>
;-to-journal-id|-to-journal-id <journal-id>
;-to-change-id|-to-change-id <change-id>
Show changes up to the specified journal position (exclusive).

;-to-date|-to-date <date>
Show changes up to the specified ISO-8601 date (exclusive).

;-to-today
Show changes up to the start of today (exclusive).

;-to-tomorrow
Show changes up to the start of tomorrow (exclusive).

;-to-now
Show changes up to the current time (exclusive).

;-after-journal-pos|-after-journal-pos <journal-id> <change-id>
Show changes after the specified journal ID and change ID.

;-changed-today
Show changes from the start of today until the start of tomorrow.
Same as `-from-today -to-tomorrow`

;-changed-yesterday
Show changes from the start of yesterday until the start of today.
Same as `-from-yesterday -to-today`
</dl>



==export|Export options==

<dl>
;-export-csv|-export-csv <filename>
;-export-efu|-export-efu <filename>
;-export-json|-export-json <filename>
;-export-m3u|-export-m3u <filename>
;-export-m3u8|-export-m3u8 <filename>
;-export-tsv|-export-tsv <filename>
;-export-txt|-export-txt <filename>
Export results to the specified file using the specified format.

;-no-header
Do not output column headers for CSV, EFU, and TSV files.

;-no-folder-append-path-separator
Do not append a trailing path separator (`\`) to folder paths.

;-utf8-bom
Write a UTF-8 byte order mark (BOM) at the start of the exported file.
</dl>



==general|General options==

<dl>
;-help
;-h
Display this help.

;-instance|-instance <name>
Connect to the Everything instance with the specified instance name.

;-pause
;-more
Pause after each page of output.

;-timeout|-timeout <milliseconds>
Wait for the Everything database to load before searching.
By default, ES does not wait for the database to load and returns no results if it is not loaded.
ES waits up to the specified number of milliseconds for the database to load.

;-set-run-count|-set-run-count <filename> <count>
Set the run count for the specified filename and exit.

;-inc-run-count|-inc-run-count <filename>
Increment the run count for the specified filename by one and exit.

;-get-run-count|-get-run-count <filename>
Display the run count for the specified filename and exit.

;-get-result-count
Display the result count for the specified search and exit.

;-get-total-size
Display the total result size for the specified search and exit.

;-get-folder-size|-get-folder-size <filename>
Display the total folder size for the specified folder and exit.

;-save-settings
Save the current search, sort, and display settings as the default settings for ES and exit.
Settings are saved to `%APPDATA%\voidtools\es\es.ini`.

For example, set the default date format to '''1''':
`es.exe -date-format 1 -save-settings`

;-clear-settings
Delete `%APPDATA%\voidtools\es\es.ini` and exit.

;-version
Display the ES `major.minor.revision.build` version and exit.

;-get-everything-version
Display the Everything `major.minor.revision.build` version and exit.

;-exit
Exit Everything.
No search is performed.
Returns after the Everything process closes.

<span id="-savedb"></span>;-save-db
Save the Everything database to disk.
No search is performed.
Returns after saving completes.

;-reindex
Force Everything to reindex.
No search is performed.
Returns after indexing completes.

;-no-result-error
Set the exit code to `9` when no results are found.

;-ipc1
;-ipc2
;-ipc3
Use IPC version 1, 2, or 3.

;-search-switch|-search <search-text>
Append search-text to your search.
The parameter is processed as a normal command line argument.
Quotes are parsed.

For example:
`es -search "abc 123"` = searches for '''abc 123''' (without quotes)

Use `"""` to escape a single literal quote (`"`)
For example:
`es -search """"abc 123""""` = searches for '''"abc 123"'''

;-search-star|-search* ...
Treat the rest of the command line as a literal search.

;--
Disable switch parsing.

;-argv
Use native command argument passing when calling ES from PowerShell 7.3 or later.
</dl>



==macros|Bookmarks and filters==

ES can reference Everything bookmarks and filters using [[support/everything/searching/#macros|macros]].
<beta1.5>



==exitcode|Exit codes==

ES can return one of the following exit codes:
{|
! Exit code !! Description
|-
| 0 || No error.<br/>The search was successful.
|-
| 1 || Failed to register window class.
|-
| 2 || Failed to create listening window.
|-
| 3 || Out of memory.
|-
| 4 || An additional command line option was expected, or a switch parameter was invalid.
|-
| 5 || Failed to create export output file.
|-
| 6 || Unknown switch.
|-
| 7 || Failed to send an Everything IPC query, or received an invalid IPC reply.
|-
| 8 || The Everything IPC window was not found.<br/>Please make sure the Everything search client is running.
|-
| 9 || No results found when used with [[#-no-result-error|-no-result-error]].
|}



==Examples==
Find files and folders with '''abc''' and '''123''' in the filename:
`es.exe abc 123`

find files and folders with '''abc 123''' in the filename:
`es.exe "abc 123"`
The space is included in the search.

Find files modified today:
`es.exe dm:today`

Show the 10 most recently modified files:
`es.exe -sort dm -n 10`

Find PDF files modified in the last 7 days:
`es.exe *.pdf dm:7days`

Find files larger than 1 GB:
`es.exe size:">"1gb`
Use `^>` or `">"` to prevent `>` from being interpreted as output redirection.

Find files in the Downloads folder:
`es.exe \downloads`

Highlight the search terms '''foo''' and '''bar''':
`es.exe foo bar -highlight`

Export all MP3 files to an Everything file list named mp3.efu:
`es.exe *.mp3 -export-efu mp3.efu`

Find the 20 largest MP4 files:
`es.exe *.mp4 -sort size -n 20`

Show the Size and Date Modified columns, set their colors, and save these as the default settings:
`es.exe -size -dm -sizecolor 0x0d -dmcolor 0x0b -save-settings`



==See also==
<ul>
*[[support/everything/searching/|Everything search syntax]]
*[[support/everything/sdk/ipc/|IPC]]
*[[support/everything/multiple_instances/|Multiple Instances]]
*[[downloads/#cli|Downloads]]
*[[https://github.com/voidtools/es]]
</ul>
